<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>The Thread class</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="pthreads.constants.html">预定义常量</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="thread.chunk.html">Thread::chunk</a></div>
 <div class="up"><a href="book.pthreads.html">pthreads</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="class.thread" class="reference">

 <h1 class="title">The Thread class</h1>
 

 <div class="partintro"><p class="verinfo">(PECL pthreads &gt;= 0.34)</p>


  <div class="section" id="thread.intro">
   <h2 class="title">简介</h2>
   <p class="para">
  An implementation of a Thread should extend this declaration, implementing the run method. When the start method of that object is called, the run method code will be executed in separate Thread.
   </p>
  </div>


  <div class="section" id="thread.synopsis">
   <h2 class="title">类摘要</h2>


   <div class="classsynopsis">
    <div class="ooclass"></div>


    <div class="classsynopsisinfo">
     <span class="ooclass">
      <strong class="classname">Thread</strong>
     </span>
     {</div>

    
    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 方法 */</div>
    <div class="methodsynopsis dc-description">
   <span class="modifier">final</span> <span class="modifier">public</span> <span class="type">boolean</span><span class="methodname"><a href="thread.chunk.html" class="methodname">chunk</a></span>
    ( <span class="methodparam"><span class="type"><span class="type long">long</span></span> <code class="parameter">$size</code></span>
   , <span class="methodparam"><span class="type">boolean</span> <code class="parameter">$preserve</code></span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">final</span> <span class="modifier">public</span> <span class="type">long</span><span class="methodname"><a href="thread.getcreatorid.html" class="methodname">getCreatorId</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">final</span> <span class="modifier">public</span> <span class="type">long</span><span class="methodname"><a href="thread.getthreadid.html" class="methodname">getThreadId</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">final</span> <span class="modifier">public</span> <span class="type">boolean</span><span class="methodname"><a href="thread.isjoined.html" class="methodname">isJoined</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">final</span> <span class="modifier">public</span> <span class="type">boolean</span><span class="methodname"><a href="thread.isrunning.html" class="methodname">isRunning</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">final</span> <span class="modifier">public</span> <span class="type">boolean</span><span class="methodname"><a href="thread.isstarted.html" class="methodname">isStarted</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">final</span> <span class="modifier">public</span> <span class="type">boolean</span><span class="methodname"><a href="thread.isterminated.html" class="methodname">isTerminated</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">final</span> <span class="modifier">public</span> <span class="type">boolean</span><span class="methodname"><a href="thread.iswaiting.html" class="methodname">isWaiting</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">final</span> <span class="modifier">public</span> <span class="type">boolean</span><span class="methodname"><a href="thread.join.html" class="methodname">join</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">final</span> <span class="modifier">public</span> <span class="type">boolean</span><span class="methodname"><a href="thread.lock.html" class="methodname">lock</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">final</span> <span class="modifier">public</span> <span class="type">boolean</span><span class="methodname"><a href="thread.merge.html" class="methodname">merge</a></span>
    ( <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$from</code></span>
   [, <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$overwrite</code></span>
  ] )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">final</span> <span class="modifier">public</span> <span class="type">boolean</span><span class="methodname"><a href="thread.notify.html" class="methodname">notify</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">final</span> <span class="modifier">public</span> <span class="type">boolean</span><span class="methodname"><a href="thread.pop.html" class="methodname">pop</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">abstract</span> <span class="modifier">public</span> <span class="type">void</span><span class="methodname"><a href="thread.run.html" class="methodname">run</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">final</span> <span class="modifier">public</span> <span class="type">boolean</span><span class="methodname"><a href="thread.shift.html" class="methodname">shift</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">final</span> <span class="modifier">public</span> <span class="type">boolean</span><span class="methodname"><a href="thread.start.html" class="methodname">start</a></span>
    ([ <span class="methodparam"><span class="type"><span class="type long">long</span></span> <code class="parameter">$options</code></span>
  ] )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">final</span> <span class="modifier">public</span> <span class="type">mixed</span><span class="methodname"><a href="thread.synchronized.html" class="methodname">synchronized</a></span>
    ( <span class="methodparam"><span class="type"><a href="class.closure.html" class="type Closure">Closure</a></span> <code class="parameter">$block</code></span>
   [, <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$...</code></span>
  ] )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">final</span> <span class="modifier">public</span> <span class="type">boolean</span><span class="methodname"><a href="thread.unlock.html" class="methodname">unlock</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">final</span> <span class="modifier">public</span> <span class="type">boolean</span><span class="methodname"><a href="thread.wait.html" class="methodname">wait</a></span>
    ([ <span class="methodparam"><span class="type"><span class="type long">long</span></span> <code class="parameter">$timeout</code></span>
  ] )</div>

   }</div>


  </div>

 </div>

 
































































































































<h2>Table of Contents</h2><ul class="chunklist chunklist_reference"><li><a href="thread.chunk.html">Thread::chunk</a> — Manipulation</li><li><a href="thread.getcreatorid.html">Thread::getCreatorId</a> — Identification</li><li><a href="thread.getthreadid.html">Thread::getThreadId</a> — Identification</li><li><a href="thread.isjoined.html">Thread::isJoined</a> — State Detection</li><li><a href="thread.isrunning.html">Thread::isRunning</a> — State Detection</li><li><a href="thread.isstarted.html">Thread::isStarted</a> — State Detection</li><li><a href="thread.isterminated.html">Thread::isTerminated</a> — State Detection</li><li><a href="thread.iswaiting.html">Thread::isWaiting</a> — State Detection</li><li><a href="thread.join.html">Thread::join</a> — Synchronization</li><li><a href="thread.lock.html">Thread::lock</a> — Synchronization</li><li><a href="thread.merge.html">Thread::merge</a> — Manipulation</li><li><a href="thread.notify.html">Thread::notify</a> — Synchronization</li><li><a href="thread.pop.html">Thread::pop</a> — Manipulation</li><li><a href="thread.run.html">Thread::run</a> — Execution</li><li><a href="thread.shift.html">Thread::shift</a> — Manipulation</li><li><a href="thread.start.html">Thread::start</a> — Execution</li><li><a href="thread.synchronized.html">Thread::synchronized</a> — Synchronization</li><li><a href="thread.unlock.html">Thread::unlock</a> — Synchronization</li><li><a href="thread.wait.html">Thread::wait</a> — Synchronization</li></ul>
</div>
<hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="pthreads.constants.html">预定义常量</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="thread.chunk.html">Thread::chunk</a></div>
 <div class="up"><a href="book.pthreads.html">pthreads</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
